package com.zcxx.cotton.sale.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zcxx.cotton.sale.mapper.BuySubsidyRecordsMapper;
import com.zcxx.cotton.sale.domain.BuySubsidyRecords;
import com.zcxx.cotton.sale.service.IBuySubsidyRecordsService;

/**
 * 交售信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class BuySubsidyRecordsServiceImpl implements IBuySubsidyRecordsService
{
    @Autowired
    private BuySubsidyRecordsMapper buySubsidyRecordsMapper;

    /**
     * 查询交售信息
     * 
     * @param id 交售信息主键
     * @return 交售信息
     */
    @Override
    public BuySubsidyRecords selectBuySubsidyRecordsById(String id)
    {
        return buySubsidyRecordsMapper.selectBuySubsidyRecordsById(id);
    }

    /**
     * 查询交售信息列表
     * 
     * @param buySubsidyRecords 交售信息
     * @return 交售信息
     */
    @Override
    public List<BuySubsidyRecords> selectBuySubsidyRecordsList(BuySubsidyRecords buySubsidyRecords)
    {
        return buySubsidyRecordsMapper.selectBuySubsidyRecordsList(buySubsidyRecords);
    }

    /**
     * 新增交售信息
     * 
     * @param buySubsidyRecords 交售信息
     * @return 结果
     */
    @Override
    public int insertBuySubsidyRecords(BuySubsidyRecords buySubsidyRecords)
    {
        buySubsidyRecords.setCreateTime(DateUtils.getNowDate().toString());
        return buySubsidyRecordsMapper.insertBuySubsidyRecords(buySubsidyRecords);
    }

    /**
     * 修改交售信息
     * 
     * @param buySubsidyRecords 交售信息
     * @return 结果
     */
    @Override
    public int updateBuySubsidyRecords(BuySubsidyRecords buySubsidyRecords)
    {
        buySubsidyRecords.setUpdateTime(DateUtils.getNowDate().toString());
        return buySubsidyRecordsMapper.updateBuySubsidyRecords(buySubsidyRecords);
    }

    /**
     * 批量删除交售信息
     * 
     * @param ids 需要删除的交售信息主键
     * @return 结果
     */
    @Override
    public int deleteBuySubsidyRecordsByIds(String[] ids)
    {
        return buySubsidyRecordsMapper.deleteBuySubsidyRecordsByIds(ids);
    }

    /**
     * 删除交售信息信息
     * 
     * @param id 交售信息主键
     * @return 结果
     */
    @Override
    public int deleteBuySubsidyRecordsById(String id)
    {
        return buySubsidyRecordsMapper.deleteBuySubsidyRecordsById(id);
    }
}
